Aaron R. Williams (@awunderground)
Our mission is to open minds, shape decisions, and offer solutions through economic and social policy research.
Our objective research helps expand opportunities for all, reduce hardship among the most vulnerable, and strengthen the effectiveness of the public sector.
Getting information into the right hands is important.
Our reports often seem like this.
Our attention spans are trained for this.
## [1] "https://imgs.xkcd.com/comics/boyfriend.png"
| state_name | hhpop | horate | medhhincome |
|---|---|---|---|
| Alabama | 1846380 | 0.6814329 | 44700 |
| Alaska | 250183 | 0.6311860 | 70600 |
| Arizona | 2463012 | 0.6206178 | 51000 |
| Arkansas | 1144657 | 0.6546031 | 42000 |
| California | 12895471 | 0.5372219 | 64600 |
| Colorado | 2074517 | 0.6389425 | 63500 |
| Connecticut | 1343704 | 0.6623386 | 71700 |
| Delaware | 352597 | 0.7096147 | 61200 |
Parameters for R Markdown documents are specified in the YAML header:
---
params:
state: "Alabama"
year: 2016
---
Parameters can then be used throughout the document:
There were 'r data$fatalities' traffic fatalities in 'r params$state' in 'r params$year'.
There were 1,038 traffic fatalities in Alabama in 2016.
# create a data frame with parameters and output file names
runs <- tibble(
# creates a string with output file names in the form <index>.pdf
output_file = str_c(index, ".html"),
# creates a nested list of parameters for each object in the index
params = map(index, ~list(state = .))
)NHTSA Traffic Safety Fact Sheets
Texas Statehouse - LoneStarMike
Encyclopedia - WestportWiki